package com.bw.config;

import lombok.Data;

@Data
public class Result<T> {
    private int state = 0;//ok
    private String message;
    private T data;

    public static <D> Result<D> ok(D d) {
        Result<D> result = new Result<D>();
        result.data = d;
        return result;
    }

    public static <D> Result<D> err(int state, String message) {
        Result<D> result = new Result<D>();
        result.state = state;
        result.message = message;
        return result;
    }
}

